<!DOCTYPE html>
<html lang="en">
{% load static %}
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- theme meta -->
    <meta name="theme-name" content="focus"/>
    <title>接口自动化测试平台搭建中</title>
    <!-- Styles -->
    <link href='{% static "css/lib/calendar2/pignose.calendar.min.css" %}' rel="stylesheet">
    <link href='{% static "css/lib/chartist/chartist.min.css" %}' rel="stylesheet">
    <link href='{% static "css/lib/font-awesome.min.css" %}' rel="stylesheet">
    <link href='{% static "css/lib/themify-icons.css" %}' rel="stylesheet">
    <link href='{% static "css/lib/owl.carousel.min.css" %}' rel="stylesheet"/>
    <link href='{% static "css/lib/owl.theme.default.min.css" %}' rel="stylesheet"/>
    <link href='{% static "css/lib/weather-icons.css" %}' rel="stylesheet"/>
    <link href='{% static "css/lib/menubar/sidebar.css" %}' rel="stylesheet">
    <link href='{% static "css/lib/bootstrap.min.css" %}' rel="stylesheet">
    <link href='{% static "css/lib/nestable/nestable.css" %}' rel="stylesheet">
    <link href='{% static "css/lib/helper.css" %}' rel="stylesheet">
    <link href='{% static "css/style.css" %}' rel="stylesheet">
    <link href='{% static "ztree/css/bootstrapStyle/bootstrapStyle.css" %}' rel="stylesheet">

    <link href='{% static "css/lib/sweetalert/sweetalert.css" %}' rel="stylesheet">
    <link href='{% static "css/lib/switch/bootstrap-switch.min.css" %}' rel="stylesheet">
    {% block css %}
    {% endblock %}
</head>

<body>

<div class="sidebar sidebar-hide-to-small sidebar-shrink sidebar-gestures">
    <div class="nano">
        <div class="nano-content">
            <ul>
                <div class="logo"><a href="{% url "index" %}">
                    <!-- <img src="images/logo.png" alt="" /> --><span>AutoTest</span></a></div>
                <li class="label">Main</li>
                <li>
                    <a class="nav-link" href="{% url 'projects:project_list' %}">
                        <i class="ti-home"></i> 项目管理
                    </a>
                </li>
                <li class="label">Apps</li>
                <li><a href="{% url 'projects:module_list' %}"><i class="ti-calendar"></i> 模块管理 </a></li>
                <li class="label">Apps</li>
                <li><a class="sidebar-sub-toggle"><i class="ti-layout"></i> 接口管理 <span
                        class="sidebar-collapse-icon ti-angle-down"></span></a>
                    <ul>
                        <li><a href="{% url 'apitests:api_define_list' %}">接口定义</a></li>
                        <li><a href="{% url 'apitests:api_case_list' %}">接口用例明细</a></li>
                        <li><a href="{% url 'apitests:api_case_auto' %}">接口自动化</a></li>
                    </ul>
                </li>
                <li class="label">Apps</li>
                <li><a href="{% url 'reports:test_report_list' %}"><i class="ti-calendar"></i> 报告管理 </a></li>

            </ul>
        </div>
    </div>
</div>
<!-- /# sidebar -->
{#    头部#}
<div class="header">
    <div class="container-fluid">
        <div class="row">
            <div class="col-lg-12">
                <div class="float-left">
                    <div class="hamburger sidebar-toggle">
                        <span class="line"></span>
                        <span class="line"></span>
                        <span class="line"></span>
                    </div>
                </div>
                <div class="float-left">
                    <div class="button-list"
                         style="position: absolute; transform: translate3d(200px, 20px, 0px); top: 0px; left: 300px; will-change: transform;">
                        <strong>所属项目:</strong>
                        <select class="btn btn-primary" name="is_project" id="project_text"
                                onchange="project_change()">
                            {% for project in projects_list %}
                                {% if is_project == project.id %}
                                    <option class="dropdown-menu show" selected
                                            value="{{ project.id }}">{{ project.name }}</option>
                                {% else %}
                                    <option class="dropdown-menu show"
                                            value="{{ project.id }}">{{ project.name }}</option>
                                {% endif %}
                            {% endfor %}
                        </select>
                    </div>
                </div>

                <div class="float-right">
                    <div class="dropdown dib">
                        <div class="header-icon" data-toggle="dropdown">
                                <span class="user-avatar">{{ user }}
                                    <i class="ti-angle-down f-s-10"></i>
                                </span>
                            <div class="drop-down dropdown-profile dropdown-menu dropdown-menu-right">
                                <div class="dropdown-content-body">
                                    <ul>
                                        <li>
                                            <a>
                                                <i class="ti-user"></i>
                                                <span>Profile（未开发）</span>
                                            </a>
                                        </li>
                                        <li>
                                            <a onclick="logout()">
                                                <i class="ti-power-off"></i>
                                                <span>Logout</span>
                                            </a>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

{#列表处#}
<div class="content-wrap">
    <div class="main">
        <div class="container-fluid">

            {% block content %}
            {% endblock %}
            {# 分页#}
            {% block paginate %}
            {% endblock %}

        </div>
    </div>
</div>


<!-- jquery vendor -->
<script src='{% static "js/lib/jquery.min.js" %}'></script>
<script src='{% static "js/lib/jquery.nanoscroller.min.js" %}'></script>
<!-- nano scroller -->
<script src='{% static "js/lib/menubar/sidebar.js" %}'></script>
<script src='{% static "js/lib/preloader/pace.min.js" %}'></script>
<!-- sidebar -->

<script src='{% static "js/scripts.js" %}'></script>
<!-- bootstrap -->
<script src='{% static "js/lib/nestable/jquery.nestable.js" %}'></script>
{#<script src='{% static "js/lib/nestable/nestable.init.js" %}'></script>#}
<script src='{% static "js/lib/calendar-2/moment.latest.min.js" %}'></script>
<script src='{% static "js/lib/calendar-2/pignose.calendar.min.js" %}'></script>
<script src='{% static "js/lib/calendar-2/pignose.init.js" %}'></script>

<script src='{% static "js/lib/weather/jquery.simpleWeather.min.js" %}'></script>
<script src='{% static "js/lib/weather/weather-init.js" %}'></script>
<script src='{% static "js/lib/circle-progress/circle-progress.min.js" %}'></script>
<script src='{% static "js/lib/circle-progress/circle-progress-init.js" %}'></script>
<script src='{% static "js/lib/chartist/chartist.min.js" %}'></script>
<script src='{% static "js/lib/sparklinechart/jquery.sparkline.min.js" %}'></script>
<script src='{% static "js/lib/sparklinechart/sparkline.init.js" %}'></script>
<script src='{% static "js/lib/owl-carousel/owl.carousel.min.js" %}'></script>
<script src='{% static "js/lib/owl-carousel/owl.carousel-init.js" %}'></script>
<script src='{% static "js/lib/sweetalert/sweetalert.min.js" %}'></script>
<script src='{% static "js/lib/sweetalert/sweetalert.init.js" %}'></script>
<script src='{% static "js/lib/switch/bootstrap-switch.min.js" %}'></script>
<script src='{% static "ztree/js/jquery.ztree.core.js" %}'></script>
<script src='{% static "ztree/js/jquery.ztree.excheck.js" %}'></script>
<script src='{% static "ztree/js/jquery.ztree.exedit.js" %}'></script>


<!-- bootstrap -->
<script src='{% static "js/lib/bootstrap.min.js" %}'></script>
<!-- scripit init-->
<script src='{% static "js/dashboard2.js" %}'></script>
{% block js %}
{% endblock %}
</body>

</html>
<script>
    function logout() {
        window.location.href = "{% url 'users:user_logout' %}"
    }

    function project_change() {
        is_project = $('#project_text').val()
        window.location.href = "{% url "index" %}" + '?is_project=' + is_project

    }
</script>
